Skip to content

Implementation of a look-up table for small topologies and changes in the dimensions of the groups of rare topology. - #1171

Merged
dberzano merged 2 commits into
AliceO2Group:devfrom
lbariogl:sviluppo
Jun 13, 2018
Merged

Implementation of a look-up table for small topologies and changes in the dimensions of the groups of rare topology.#1171
dberzano merged 2 commits into
AliceO2Group:devfrom
lbariogl:sviluppo

Conversation

@lbariogl

@lbariogl lbariogl commented Jun 6, 2018

Copy link
Copy Markdown
Contributor

A look-up table containing all the IDs of topologies whose bitmap is contained in 1B has been added. Thus it is possible to avoid the computation of the hashcode for the smallest (and very common) topologies when ecountered. Indeed, the LUT element is directly accessed through its 1-Byte bitmap.

Then the dimensions of the groups of rare topologies have changed. Previously, the maximum size of the pattern was 32x32 (defined in TopologyDictionary). However, all the topologies with one dimensions exceeding this limit belonged to the group with 32 as number of row or columns. Now, the maximum number of rows/columns has been increased to the highest possible number for a topology with 512 pixels (Cluster::kMaxPatternBits).

@lbariogl
lbariogl force-pushed the sviluppo branch 2 times, most recently from e507af9 to 86907a2 Compare June 6, 2018 12:36

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is not really returning anything (it is "filling" something maybe). mBitmap seems to be a std::array like object so I guess one could just say

std::array<char, N> getPattern() const { return mBitmap; }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what was the motivation for this change? (see above)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted to the array<unsigned char, N> version.
The change should have been only temporary, since I had some problems during the implementation of the last modifications to the code, but then I forgot to switch back. Now everything works fine.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please put '{}' even around single line if-bodies (see coding rules).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put them. Thank you

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the previous version I've changed your unordered_map to map just because otherwise it was failing the MacOS test. With the reintroduction of the unordered_map, failure is now back. I am sure this is a root bug, will it work for the moment with map, until we sort out the unordered_map problem?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need actually to spend time on nBytes calculation, can check directly if (nBits<9) { // small topology

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right: done

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the previous version I've changed your std::unordered_map to std::map because otherwise it was failing the PR test on MacOS. With your reintroduction of the unordered_map the failure is back. Will it work with std::map for the moment, until we sort out the problem with unordered_map (apparently a root bug)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @shahor02, you just anticipated me. I passed to unordered_map since I thought that the problem was solved in the meanwhile. Then, when this probIem showed up, I suspected that the reason of the problem was unordered_map. However, the strange thing is that everything compiles on my laptop, i.e. on macOS.
For the time being I will pass to map

@sawenzel

sawenzel commented Jun 7, 2018

Copy link
Copy Markdown
Collaborator

Please use git rebase dev instead of git merge dev.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You add +2 to a constant in multiple places. I think it would be more readable to define another constant which has the meaning of kMaxPatterBytes + 2.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you: done

@lbariogl
lbariogl force-pushed the sviluppo branch 2 times, most recently from 9cbf0de to b6e86be Compare June 7, 2018 13:21
@sawenzel

sawenzel commented Jun 7, 2018

Copy link
Copy Markdown
Collaborator

Thanks. Looks good to me. @iouribelikov, @bovulpes, @shahor02 : Should we go ahead?

@sawenzel

sawenzel commented Jun 7, 2018

Copy link
Copy Markdown
Collaborator

@dberzano : The macos builds seem not to be active for the last hours. Is the machine down?

ClusterPattern includes a bitmap with the number of rows and the number of columns in the
first two bytes. The remaining bytes contain the very bitmap of the
cluster.

The dictionary now contains a lookup table with the group ID
corresponding to the topologis whose bitmap can be contained in a single
byte.
@lbariogl
lbariogl force-pushed the sviluppo branch 2 times, most recently from 5ed6c08 to 1cdabf4 Compare June 11, 2018 07:40
The maximum number of rows and columns for groups of rare topology is
set to the highest number that can contain the complete pixel bitmap
(Cluster::kMaxPatternBits).
@AliceO2Group AliceO2Group deleted a comment from alibuild Jun 12, 2018
@AliceO2Group AliceO2Group deleted a comment from alibuild Jun 12, 2018
@AliceO2Group AliceO2Group deleted a comment from alibuild Jun 12, 2018
@AliceO2Group AliceO2Group deleted a comment from alibuild Jun 12, 2018
@AliceO2Group AliceO2Group deleted a comment from alibuild Jun 12, 2018
@AliceO2Group AliceO2Group deleted a comment from alibuild Jun 12, 2018
@dberzano

dberzano commented Jun 12, 2018

Copy link
Copy Markdown
Contributor

@sawenzel for the record, since the question popped up, -Werror is active at the moment (we've never turned it off centrally), as shown by the following message:

/build/ci_checks/o2_checker_macos_o2_ci_0/sw/SOURCES/O2/1171/0/Detectors/ITSMFT/common/reconstruction/src/PixelData.cxx:23:69: error: static_assert with no message is a C++17 extension [-Werror,-Wc++17-extensions]
  static_assert(RowMask + 1 >= o2::ITSMFT::SegmentationAlpide::NRows);

@sawenzel

Copy link
Copy Markdown
Collaborator

@iouribelikov , @shahor02 : Should we go ahead?

@shahor02

Copy link
Copy Markdown
Collaborator

@sawenzel Yes, for me it is fine

@iouribelikov

Copy link
Copy Markdown
Collaborator

@sawenzel OK. Let's merge it.

@shahor02

shahor02 commented Jun 13, 2018 via email

Copy link
Copy Markdown
Collaborator

@shahor02

Copy link
Copy Markdown
Collaborator

Hi, fortunately, my worries were baseless, please go ahead with merging.

@dberzano
dberzano merged commit 738c495 into AliceO2Group:dev Jun 13, 2018
@lbariogl
lbariogl deleted the sviluppo branch June 13, 2018 15:23
mikesas pushed a commit to mikesas/AliceO2 that referenced this pull request Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants